#include<iostream>
#include<math.h>

using namespace std;
int n;
double x[1000], y[1000], xx, yy;
int main(){
    scanf("%d", &n);
    for(int i=0;i<=n;i++){
        scanf("%lf %lf", &x[i],&y[i]);
    }
    scanf("%lf", &xx);
    for(int i=0;i<=n;i++){
        double t=1.0;
        for(int k=0;k<=n;k++){
            if(i!=k)
                t = t * ((xx-x[k])/(x[i]-x[k]));
        }
        yy = yy + t*y[i];
    }
    printf("yy:%.19lf\n", yy);
    return 0;
}